// <umd>
const localeName = 'Cn',
  localeDesc = 'zh-CN',
  locale = {
    localeName,
    localeDesc,

    // Translations for common words and phrases which are used by all classes.
    Object: {
      Yes: '是',
      No: '否',
      Cancel: '取消',
      Save: '保存',
      Delete: '删除'
    },

    // region Widgets

    Combo: {
      noResults: '没有结果'
    },
    ProjectLines: {
      'Project Start': '任务开始',
      'Project End': '任务结束'
    },

    FilePicker: {
      file: '文件'
    },
    WBSColumn: {
      WBS: '序号'
    },
    SchedulerProCommon: {
      SS: 'SS',
      SF: 'SF',
      FS: 'FS',
      FF: 'FF',
      StartToStart: '开始-至-开始',
      StartToEnd: '开始-至-结束',
      EndToStart: '结束-至-开始',
      EndToEnd: '结束-至-结束',
      dependencyTypes: ['SS', 'SF', 'FS', 'FF'],
      dependencyTypesLong: ['开始-至-开始', '开始-至-结束', '结束-至-开始', '结束-至-结束']
    },
    Field: {
      // native input ValidityState statuses
      badInput: '无效的字段值',
      patternMismatch: '值应该匹配特定的模式',
      rangeOverflow: value => `值必须小于或等于 ${value.max}`,
      rangeUnderflow: value => `值必须大于或等于 ${value.min}`,
      stepMismatch: '值应该与步骤相匹配',
      tooLong: '值应该更短',
      tooShort: '值应该更长',
      typeMismatch: '值必须采用特殊格式',
      valueMissing: '此字段是必需的',

      invalidValue: '无效的字段值',
      minimumValueViolation: '最小值违反',
      maximumValueViolation: '最大值违反',
      fieldRequired: '此字段是必需的',
      validateFilter: '值必须从列表中选择'
    },

    DateField: {
      invalidDate: '无效的日期输入'
    },

    NumberFormat: {
      locale: 'zh-CN',
      currency: 'cn'
    },

    TimeField: {
      invalidTime: '无效的时间输入'
    },

    List: {
      loading: '加载中...'
    },

    PagingToolbar: {
      firstPage: '转到第一页',
      prevPage: '转到前一页',
      page: '页面',
      nextPage: '转到下一页',
      lastPage: '转到最后一页',
      reload: '刷新当前页面',
      noRecords: '没有记录显示',
      pageCountTemplate: data => `of ${data.lastPage}`,
      summaryTemplate: data => `显示记录 ${data.start} - ${data.end} of ${data.allCount}`
    },

    // endregion

    // region Others

    DateHelper: {
      locale: 'zh-CN',
      shortWeek: 'W',
      shortQuarter: '季度', // "q",
      week: '周',
      weekStartDay: 0,
      unitNames: [
        // { single: "millisecond", plural: "ms", abbrev: "ms" },
        { single: '毫秒', plural: '毫秒', abbrev: '毫秒' },

        // { single: "second", plural: "seconds", abbrev: "s" },
        { single: '秒', plural: '秒', abbrev: '秒' },

        // { single: "minute", plural: "minutes", abbrev: "min" },
        { single: '分', plural: '分', abbrev: '分' },

        // { single: "hour", plural: "hours", abbrev: "h" },
        { single: '时', plural: '时', abbrev: '时' }, // 对应资源冲突单位

        // { single: "day", plural: "days", abbrev: "d" },
        { single: '天', plural: '天', abbrev: '天' },

        // { single: "week", plural: "weeks", abbrev: "w" },
        { single: '周', plural: '周', abbrev: '周' },

        // { single: "month", plural: "months", abbrev: "mon" },
        { single: '月', plural: '月', abbrev: '月' },

        // { single: "quarter", plural: "quarters", abbrev: "q", },
        { single: '季度', plural: '季度', abbrev: '季度' },

        // { single: "year", plural: "years", abbrev: "yr" }
        { single: '年', plural: '年', abbrev: '年' }
      ],
      unitAbbreviations: [
        ['毫秒'],
        ['秒', '秒'],
        ['分', '分'],
        ['时', '时'], // ["h", "hr"],
        ['天'],
        ['周', '周'],
        ['月', '月', '月'],
        ['季度', '季度', '季度'], //  ["q", "quar", "qrt"]
        ['年', '年']
      ],
      // parsers: { L: "MM/DD/YYYY", LT: "HH:mm A" },
      parsers: { L: 'YYYY-mm-DD', LT: 'HH:mm A' },
      ordinalSuffix: function (e) {
        return e + ({ 1: 'st', 2: 'nd', 3: 'rd' }[e[e.length - 1]] || 'th')
      }
    },
    // Used to build a RegExp for parsing time units.
    // The full names from above are added into the generated Regexp.
    // So you may type "2 w" or "2 wk" or "2 week" or "2 weeks" into a DurationField.
    // When generating its display value though, it uses the full localized names above.
    unitAbbreviations: [
      ['毫秒'],
      ['秒', '秒'],
      ['分', '分'],
      ['时', '时'],
      ['天'],
      ['周', '周'],
      ['月', '月', '月'],
      ['季度', '季度', '季度'],
      ['年', '年']
    ],
    parsers: {
      L: 'YYYY-MM-DD',
      LT: 'HH:mm A'
    },
    ordinalSuffix: number => number + ({ 1: 'st', 2: 'nd', 3: 'rd' }[number[number.length - 1]] || 'th'),

    // region Features

    ColumnPicker: {
      column: '列',
      columnsMenu: '列',
      hideColumn: '隐藏列',
      hideColumnShort: '隐藏'
    },
    NameColumn: {
      Name: '名称'
    },

    AssignmentGrid: {
      Name: '资源名称',
      Units: '单位',
      unitsTpl: ({ value }) => (value ? value + '%' : '')
    },

    GanttBase: {
      propagating: '计算项目',
      storePopulation: '加载数据'
    },

    ResourceAssignmentColumn: {
      'Assigned Resources': '分配资源',
      'more resources': '更多的资源'
    },
    TaskTooltip: {
      Start: '开始时间',
      End: '结束时间',
      Duration: '持续时间',
      Complete: '任务完成'
    },
    Gantt: {
      Edit: '修改任务',
      Indent: '缩进',
      Outdent: '突出',
      'Convert to milestone': '转换为里程碑',
      Add: '新增...',
      'New task': '添加事件',
      'New milestone': '添加里程碑',
      'Task above': '上方',
      'Task below': '下方',
      'Delete task': '删除事件',
      Milestone: '里程碑',
      'Sub-task': '子事件',
      Successor: '后置',
      Predecessor: '前置',
      changeRejected: 'Scheduling engine rejected the changes'
    },
    Filter: {
      applyFilter: '应用过滤器',
      filter: '过滤器',
      editFilter: '编辑过滤器',
      on: '在',
      before: '之前',
      after: '后',
      equals: '等',
      lessThan: '不到',
      moreThan: '超过',
      removeFilter: '删除过滤器'
    },

    FilterBar: {
      enableFilterBar: '显示过滤器栏',
      disableFilterBar: '隐藏过滤器栏'
    },

    Group: {
      group: '集团',
      groupAscending: '集团提升',
      groupDescending: '集团下',
      groupAscendingShort: '提升',
      groupDescendingShort: '下行',
      stopGrouping: '停止分组',
      stopGroupingShort: '停止'
    },

    Search: {
      searchForValue: '寻找价值'
    },

    Sort: {
      sort: '排序',
      sortAscending: '升序',
      sortDescending: '降序',
      multiSort: '多类',
      removeSorter: '删除分类器',
      addSortAscending: '添加提升分类器',
      addSortDescending: '添加下行分选机',
      toggleSortAscending: '改变提升',
      toggleSortDescending: '改变下行',
      sortAscendingShort: '提升',
      sortDescendingShort: '下行',
      removeSorterShort: '删除',
      addSortAscendingShort: '+提升',
      addSortDescendingShort: '+下降'
    },

    // endregion

    // region Grid

    GridBase: {
      loadFailedMessage: '数据加载失败！',
      syncFailedMessage: '数据同步失败!',
      unspecifiedFailure: '未指明的失败',
      networkFailure: '网络错误',
      parseFailure: '解析服务器响应失败',
      loadMask: '加载中...',
      syncMask: '保存更改，请稍等…',
      noRows: '暂无数据',
      moveColumnLeft: '移动到左段',
      moveColumnRight: '移动到右段',
      removeRow: '删除记录',
      removeRows: '删除记录',
      moveColumnTo: region => `列移动到 ${region}`
    },

    CellMenu: {
      removeRow: '删除记录',
      removeRows: '删除记录'
    },

    // endregion

    // region Export

    PdfExport: {
      'Waiting for response from server': '等待服务器响应…',
      'Export failed': '导出失败',
      'Server error': '服务器错误',
      'Generating pages': '生成的页面…'
    },

    ExportDialog: {
      width: '40em',
      labelWidth: '12em',
      exportSettings: '出口设置',
      export: '导出',
      exporterType: '控制分页',
      cancel: '取消',
      fileFormat: '文件格式',
      rows: '行',
      alignRows: '行对齐',
      columns: '列',
      paperFormat: '页格式',
      orientation: '方向',
      repeatHeader: '重复标题'
    },

    ExportRowsCombo: {
      all: '所有行',
      visible: '可见的行'
    },

    ExportOrientationCombo: {
      portrait: '描述',
      landscape: '打印格式'
    },

    SinglePageExporter: {
      singlepage: '单页'
    },

    MultiPageExporter: {
      multipage: '多个页面',
      exportingPage: ({ currentPage, totalPages }) => `导出页面 ${currentPage}/${totalPages}`
    },

    MultiPageVerticalExporter: {
      multipagevertical: '多个页面(垂直)',
      exportingPage: ({ currentPage, totalPages }) => `导出页面 ${currentPage}/${totalPages}`
    },
    ResourceInfoColumn: {
      eventCountText: function (data) {
        return data + ' 事件' + (data !== 1 ? 's' : '')
      }
    },

    Dependencies: {
      from: '开始',
      to: '结束',
      valid: '有效',
      invalid: '无效'
    },

    DependencyType: {
      SS: 'SS',
      SF: 'SF',
      FS: 'FS',
      FF: 'FF',
      StartToStart: 'Start-to-Start',
      StartToEnd: 'Start-to-End',
      EndToStart: 'End-to-Start',
      EndToEnd: 'End-to-End',
      short: ['SS', 'SF', 'FS', 'FF'],
      long: ['Start-to-Start', 'Start-to-End', 'End-to-Start', 'End-to-End']
    },

    DependencyEdit: {
      From: '从',
      To: '到',
      Type: '类型',
      Lag: '滞后',
      'Edit dependency': '编辑依赖',
      Save: '保存',
      Delete: '删除',
      Cancel: '取消',
      StartToStart: '开始 - 开始',
      StartToEnd: '开始 - 结束',
      EndToStart: '结束 - 开始',
      EndToEnd: '结束 - 结束'
    },

    EventEdit: {
      Name: '名字',
      Resource: '资源',
      Start: '开始',
      End: '结束',
      Save: '保存',
      Delete: '删除',
      Cancel: '取消',
      'Edit event': '编辑',
      Repeat: '重复',

      Information: '基本信息'
    },
    TaskEditorBase: {
      Information: '基本信息',
      Save: '保存的',
      Cancel: '取消',
      Delete: '删除',
      calculateMask: '计算中...',
      saveError: '请填写完整属性'
    },
    SchedulerGeneralTab: {
      labelWidth: '6em',
      General: '基本',
      Name: '名称',
      Resources: '资源',
      '% complete': '完成（%）',
      Duration: '持续',
      Start: '开始',
      Finish: '结束'
    },
    DependencyTab: {
      Predecessors: 'Predecessors',
      Successors: '成功',
      ID: 'id',
      Name: '名称',
      Type: '类型',
      Lag: 'Lag',
      cyclicDependency: 'Cyclic dependency has been detected',
      invalidDependency: 'Invalid dependency'
    },
    EventDrag: {
      eventOverlapsExisting: '事件与此资源的现有事件重叠',
      noDropOutsideTimeline: '事件不能完全被拖出时间轴之外'
    },

    SchedulerBase: {
      'Add event': '添加事件',
      'Delete event': '删除事件',
      'Unassign event': '取消事件'
    },

    // TODO: 'headerContextMenu' is deprecated. Please see https://bryntum.com/docs/scheduler/#guides/upgrades/4.0.0.md for more information.
    HeaderContextMenu: {
      pickZoomLevel: '缩放等级',
      activeDateRange: '时间',
      startText: '开始时间',
      endText: '结束时间',
      todayText: '今日'
    },

    TimeAxisHeaderMenu: {
      pickZoomLevel: '缩放等级',
      activeDateRange: '时间范围',
      startText: '开始时间',
      endText: '结束时间',
      todayText: '今日'
    },

    EventFilter: {
      filterEvents: '检索任务',
      byName: '名称'
    },

    TimeRanges: {
      showCurrentTimeLine: '显示当前时间'
    },

    PresetManager: {
      secondAndMinute: {
        topDateFormat: 'YYYY年M月D日 hh:mm',
        middleDateFormat: 'ss'
        // displayDateFormat: 'LTS ll'
      },
      minuteAndHour: {
        topDateFormat: 'YYYY年M月D日 LST',
        middleDateFormat: 'YYYY年M月D日 LST',
        bottomDateFormat: 'YYYY年M月D日 LST',
        displayDateFormat: 'LST ll'
      },

      monthAndYear: {
        topDateFormat: 'YYYY年',
        middleDateFormat: 'M月'
      },
      hourAndDay: {
        topDateFormat: 'YYYY年M月D日 ddd',
        middleDateFormat: 'LST',
        displayDateFormat: 'LST ll'
      },
      dayAndWeek: {
        topDateFormat: '1',
        middleDateFormat: '2',
        bottomDateFormat: '3',
        desc: '使用weekAndDay'
      },
      weekAndDay: {
        topDateFormat: 'YYYY年M月D日',
        middleDateFormat: 'YYYY年M月',
        bottomDateFormat: 'DD ddd'
      },
      weekAndDayLetter: {
        topDateFormat: 'YYYY年M月D日',
        middleDateFormat: 'M月D日',
        bottomDateFormat: 'D日'
      },
      weekAndMonth: {
        topDateFormat: 'YYYY年M月',
        middleDateFormat: 'D日'
      },
      weekDateAndMonth: {
        topDateFormat: 'YYYY年M月',
        middleDateFormat: 'D日'
      },
      year: {
        topDateFormat: 'YYYY年',
        middleDateFormat: 'M月',
        bottomDateFormat: 'M月'
      },
      years: {
        topDateFormat: 'YYYY年',
        middleDateFormat: 'YYYY年',
        bottomDateFormat: 'YYYY年'
      },
      manyYears: {
        middleDateFormat: 'YYYY年',
        bottomDateFormat: 'YYYY年'
      }
    },

    RecurrenceConfirmationPopup: {
      'delete-title': '您正在删除一个事件',
      'delete-all-message': '是否要删除此事件的所有发生?',
      'delete-further-message': '您想要删除这个事件和该事件的所有未来发生的事件，还是只删除选中的事件?',
      'delete-further-btn-text': '删除所有未来事件',
      'delete-only-this-btn-text': '仅删除此事件',

      'update-title': '您正在更改一个重复的事件',
      'update-all-message': '是否要更改此事件的所有发生?',
      'update-further-message': '您想只改变事件的这一发生，还是这一和所有未来发生的事件?',
      'update-further-btn-text': '未来所有的事件',
      'update-only-this-btn-text': '只有这个事件',

      Yes: '确定',
      Cancel: '取消',

      width: 600
    },

    RecurrenceLegend: {
      ' and ': ' 和 ',
      // frequency patterns
      Daily: '每天',

      // Weekly on Sunday
      // Weekly on Sun, Mon and Tue
      'Weekly on {1}': ({ days }) => `每周 ${days}`,

      // Monthly on 16
      // Monthly on the last weekday
      'Monthly on {1}': ({ days }) => `每月 ${days}`,

      // Yearly on 16 of January
      // Yearly on the last weekday of January and February
      'Yearly on {1} of {2}': ({ days, months }) => `每年 ${days} of ${months}`,

      // Every 11 days
      'Every {0} days': ({ interval }) => `每 ${interval} 天`,

      // Every 2 weeks on Sunday
      // Every 2 weeks on Sun, Mon and Tue
      'Every {0} weeks on {1}': ({ interval, days }) => `每 ${interval} 周 在 ${days}`,

      // Every 2 months on 16
      // Every 2 months on the last weekday
      'Every {0} months on {1}': ({ interval, days }) => `每 ${interval} 月 在 ${days}`,

      // Every 2 years on 16 of January
      // Every 2 years on the last weekday of January and February
      'Every {0} years on {1} of {2}': ({ interval, days, months }) => `每 ${interval} 年 在 ${days} of ${months}`,

      // day position translations
      position1: '第一个',
      position2: '第二个',
      position3: '第三个',
      position4: '第四',
      position5: '第五个',
      'position-1': '最后一个',
      // day options
      day: '天',
      weekday: '工作日',
      'weekend day': '周末的一天',
      // {0} - day position info ("the last"/"the first"/...)
      // {1} - day info ("Sunday"/"Monday"/.../"day"/"weekday"/"weekend day")
      // For example:
      //  "the last Sunday"
      //  "the first weekday"
      //  "the second weekend day"
      daysFormat: ({ position, days }) => `${position} ${days}`
    },

    RecurrenceEditor: {
      'Repeat event': '重复的事件',
      Cancel: '取消',
      Save: '保存',
      Frequency: '频率',
      Every: '每一个',
      DAILYintervalUnit: '天(s)',
      WEEKLYintervalUnit: '周(s)',
      MONTHLYintervalUnit: '月(s)',
      YEARLYintervalUnit: '年(s)',
      Each: '每一个',
      'On the': '在',
      'End repeat': '最后重复一遍',
      'time(s)': '时间(s)'
    },

    RecurrenceDaysCombo: {
      day: '天',
      weekday: '周',
      'weekend day': '周末'
    },

    RecurrencePositionsCombo: {
      position1: '第一',
      position2: '第二',
      position3: '第三',
      position4: '第四',
      position5: '第五',
      'position-1': '最后一个'
    },

    RecurrenceStopConditionCombo: {
      Never: '从未',
      After: '之后',
      'On date': '在日期'
    },

    RecurrenceFrequencyCombo: {
      Daily: '每天',
      Weekly: '每周',
      Monthly: '每月',
      Yearly: '每年'
    },

    RecurrenceCombo: {
      None: '没有',
      Custom: '自定义...'
    },

    // region Features

    Summary: {
      'Summary for': date => `总结 ${date}`
    },

    // endregion

    // region Export

    ScheduleRangeCombo: {
      completeview: '完整的计划',
      currentview: '可见的时间表',
      daterange: '日期范围',
      completedata: '完整时间表(对所有事件)'
    },

    SchedulerExportDialog: {
      'Schedule range': '计划范围内',
      'Export from': '从',
      'Export to': '到'
    },

    ExcelExporter: {
      'No resource assigned': '没有资源分配'
    },

    // endregion

    CrudManagerView: {
      serverResponseLabel: '服务器响应:'
    }
  }

// endregion

export default locale
// </umd>
